home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / misc / libx11inc.lha / X11 / Xm / DragC.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-13  |  6.2 KB  |  230 lines

  1. /* 
  2.  * (c) Copyright 1989, 1990, 1991, 1992 OPEN SOFTWARE FOUNDATION, INC.
  3.  * ALL RIGHTS RESERVED
  4. */ 
  5. /*   $RCSfile: DragC.h,v $ $Revision: 1.38 $ $Date: 92/05/14 12:49:52 $ */
  6. /*
  7. *  (c) Copyright 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
  8. /* $Header: DragC.h,v 1.38 92/05/14 12:49:52 motif Exp $ */
  9.  
  10. #ifndef _XmDragController_h
  11. #define _XmDragController_h
  12.  
  13. #include <Xm/Xm.h>
  14. #include <Xm/Display.h>
  15.  
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19.  
  20.  
  21. /* defines for the dragFinish completionStatus field */
  22.  
  23. #define XmHELP            2
  24.  
  25. /*
  26.  * Some global stuff that will go into Xm.h
  27.  */
  28. typedef unsigned int    XmID;
  29.  
  30. /***********************************************************************
  31.  *
  32.  * DragContext
  33.  *
  34.  ***********************************************************************/
  35.  
  36. #ifndef XmIsDragContext
  37. #define XmIsDragContext(w) XtIsSubclass(w,xmDragContextClass)
  38. #endif /* XmIsDragContext */
  39.  
  40. #ifndef _XA_MOTIF_DROP
  41. #define _XA_MOTIF_DROP "_MOTIF_DROP"
  42. #define _XA_DRAG_FAILURE "_MOTIF_DRAG_FAILURE"
  43. #define _XA_DRAG_SUCCESS "_MOTIF_DRAG_SUCCESS"
  44. #endif /* _XA_MOTIF_DROP */
  45.  
  46.  
  47. /* enums used for the message_type in client messages */
  48.  
  49. enum{    XmTOP_LEVEL_ENTER,        XmTOP_LEVEL_LEAVE,
  50.     XmDRAG_MOTION,            XmDROP_SITE_ENTER,
  51.     XmDROP_SITE_LEAVE,        XmDROP_START,
  52.     XmDROP_FINISH,            XmDRAG_DROP_FINISH,
  53.     XmOPERATION_CHANGED
  54.     } ;
  55.  
  56. /* enums for completionStatus */
  57. enum{    XmDROP,                XmDROP_HELP,
  58.     XmDROP_CANCEL,            XmDROP_INTERRUPT
  59.     } ;
  60.  
  61. /* values for operation */
  62. #define    XmDROP_NOOP    0L
  63. #define XmDROP_MOVE     (1L << 0)
  64. #define XmDROP_COPY    (1L << 1)
  65. #define XmDROP_LINK    (1L << 2)
  66.  
  67. enum{    XmBLEND_ALL,            XmBLEND_STATE_SOURCE,
  68.     XmBLEND_JUST_SOURCE,        XmBLEND_NONE
  69.     } ;
  70.  
  71. enum{      XmDROP_FAILURE,            XmDROP_SUCCESS
  72.     } ;
  73.  
  74.  
  75. /* enums used for the public callback reason */
  76.  
  77. enum{    XmCR_TOP_LEVEL_ENTER,        XmCR_TOP_LEVEL_LEAVE,
  78.     XmCR_DRAG_MOTION,        XmCR_DROP_SITE_ENTER,
  79.     XmCR_DROP_SITE_LEAVE,        XmCR_DROP_START,
  80.     XmCR_DROP_FINISH,        XmCR_DRAG_DROP_FINISH,
  81.     XmCR_OPERATION_CHANGED,
  82.  
  83.     _XmNUMBER_DND_CB_REASONS
  84.     } ;
  85.  
  86.  
  87. /* Class record constants */
  88. typedef struct _XmDragContextClassRec    *XmDragContextClass;
  89. typedef struct _XmDragContextRec    *XmDragContext;
  90. extern WidgetClass xmDragContextClass;
  91.  
  92. typedef struct _XmAnyICCCallbackStruct{
  93.     int              reason;
  94.     XEvent              *event;
  95.     Time                timeStamp;
  96. }XmAnyICCCallbackStruct, *XmAnyICCCallback;
  97.  
  98. typedef struct _XmTopLevelEnterCallbackStruct{
  99.     int              reason;
  100.     XEvent              *event;
  101.     Time                timeStamp;
  102.     Screen        *screen;
  103.     /*
  104.      * the window field is different if this is an outbound or inbound
  105.      * callback. Outbound == reciever, Inbound == initiator.
  106.      */
  107.     Window        window;
  108.     Position        x, y;
  109.     unsigned char    dragProtocolStyle;
  110.     Atom        iccHandle;
  111. }XmTopLevelEnterCallbackStruct, *XmTopLevelEnterCallback;
  112.  
  113. typedef struct _XmTopLevelLeaveCallbackStruct{
  114.     int              reason;
  115.     XEvent              *event;
  116.     Time                timeStamp;
  117.     Screen        *screen;
  118.     Window        window;
  119. }XmTopLevelLeaveCallbackStruct, *XmTopLevelLeaveCallback;
  120.  
  121. /* 
  122.  * this message is sent from the receiver to the initiator to
  123.  * indicate that the motion message with the associated timestamp has
  124.  * caused a drop-site to be entered
  125.  */
  126. typedef struct _XmDropSiteEnterCallbackStruct{
  127.     int              reason;
  128.     XEvent              *event;
  129.     Time                timeStamp;
  130.     unsigned char    operation;
  131.     unsigned char    operations;
  132.     unsigned char    dropSiteStatus;
  133.     Position        x, y;
  134. }XmDropSiteEnterCallbackStruct, *XmDropSiteEnterCallback;
  135.  
  136. /* 
  137.  * this message is sent from the receiver to the initiator to
  138.  * indicate that the motion message with the associated timestamp has
  139.  * caused a drop-site to be left
  140.  */
  141. typedef struct _XmDropSiteLeaveCallbackStruct{
  142.     int              reason;
  143.     XEvent              *event;
  144.     Time                timeStamp;
  145. }XmDropSiteLeaveCallbackStruct, *XmDropSiteLeaveCallback;
  146.  
  147. typedef struct _XmDragMotionCallbackStruct{
  148.     int              reason;
  149.     XEvent              *event;
  150.     Time                timeStamp;
  151.     unsigned char    operation;
  152.     unsigned char    operations;
  153.     unsigned char    dropSiteStatus;
  154.     Position        x, y;
  155. }XmDragMotionCallbackStruct, *XmDragMotionCallback;
  156.  
  157. typedef struct _XmOperationChangedCallbackStruct{
  158.     int              reason;
  159.     XEvent              *event;
  160.     Time                timeStamp;
  161.     unsigned char    operation;
  162.     unsigned char    operations;
  163.     unsigned char    dropSiteStatus;
  164. }XmOperationChangedCallbackStruct, *XmOperationChangedCallback;
  165.  
  166. typedef struct _XmDropStartCallbackStruct{
  167.     int              reason;
  168.     XEvent              *event;
  169.     Time                timeStamp;
  170.     unsigned char    operation;
  171.     unsigned char    operations;
  172.     unsigned char    dropSiteStatus;
  173.     unsigned char    dropAction;
  174.     Position        x, y;
  175.     Window        window;
  176.     Atom        iccHandle;
  177. }XmDropStartCallbackStruct, *XmDropStartCallback;
  178.  
  179. typedef struct _XmDropFinishCallbackStruct{
  180.     int              reason;
  181.     XEvent              *event;
  182.     Time                timeStamp;
  183.     unsigned char    operation;
  184.     unsigned char    operations;
  185.     unsigned char    dropSiteStatus;
  186.     unsigned char    dropAction;
  187.     unsigned char    completionStatus;
  188. }XmDropFinishCallbackStruct, *XmDropFinishCallback;
  189.  
  190. typedef struct _XmDragDropFinishCallbackStruct{
  191.     int              reason;
  192.     XEvent              *event;
  193.     Time                timeStamp;
  194. }XmDragDropFinishCallbackStruct, *XmDragDropFinishCallback;
  195.  
  196.  
  197. /********    Public Function Declarations    ********/
  198. #ifdef _NO_PROTO
  199.  
  200. extern Widget XmDragStart() ;
  201. extern void XmDragCancel() ;
  202. extern Boolean XmTargetsAreCompatible() ;
  203.  
  204. #else
  205.  
  206. extern Widget XmDragStart( 
  207.                         Widget w,
  208.                         XEvent *event,
  209.                         ArgList args,
  210.                         Cardinal numArgs) ;
  211. extern void XmDragCancel( 
  212.                         Widget dragContext) ;
  213. extern Boolean XmTargetsAreCompatible( 
  214.                         Display *dpy,
  215.                         Atom *exportTargets,
  216.                         Cardinal numExportTargets,
  217.                         Atom *importTargets,
  218.                         Cardinal numImportTargets) ;
  219.  
  220. #endif /* _NO_PROTO */
  221. /********    End Public Function Declarations    ********/
  222.  
  223.  
  224. #ifdef __cplusplus
  225. }  /* Close scope of 'extern "C"' declaration which encloses file. */
  226. #endif
  227.  
  228. #endif /* _DragController_h */
  229. /* DON'T ADD STUFF AFTER THIS #endif */
  230.